﻿<Window x:Class="CSSAdriverapp.EditVehicleType"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Edit Vehicle Type" Height="261" Width="426" xmlns:my="clr-namespace:CSSAdriverapp" ResizeMode="NoResize" Icon="/CSSA%20Driver%20App;component/lorry_green_256.ico">
    <Grid Background="#C5AFB1AF">
        <DataGrid AutoGenerateColumns="False" Height="200" HorizontalAlignment="Left" Margin="8,10,0,0" Name="displayDataGrid" VerticalAlignment="Top" Width="129" DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=my:EditVehicleType, AncestorLevel=1}, Path=types}" ItemsSource="{Binding}" SelectionChanged="dataGrid1_SelectionChanged"  CanUserAddRows="False" IsReadOnly="True" GridLinesVisibility="None">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Name}" Header="Name" />
                <DataGridTextColumn Binding="{Binding Path=NumOfSeats}" Header="Seats" />
            </DataGrid.Columns>
        </DataGrid>
        <Label Content="Selected Type" Height="28" HorizontalAlignment="Left" Margin="176,10,0,0" Name="label1" VerticalAlignment="Top" FontStyle="Italic" />
        <Label Content="Name:" Height="28" HorizontalAlignment="Left" Margin="153,44,0,0" Name="nameHeadingLabel" VerticalAlignment="Top" />
        <Label Content="Seats:" Height="28" HorizontalAlignment="Left" Margin="156,78,0,0" Name="seatsHeadingLabel" VerticalAlignment="Top" />
        <Slider Height="23" HorizontalAlignment="Left" Margin="156,112,0,0" Name="slider" VerticalAlignment="Top" Width="236" Maximum="100" IsSnapToTickEnabled="True" />
        <Label Content="{Binding ElementName=slider1, Path=Value}" Height="28" HorizontalAlignment="Left" Margin="203,78,0,0" Name="numOfSeatsLabel" VerticalAlignment="Top" Width="53" />
        <TextBox Height="23" HorizontalAlignment="Left" Margin="203,46,0,0" Name="nameTextBox" VerticalAlignment="Top" Width="174" />
        <Button Content="Save" Height="23" HorizontalAlignment="Left" Margin="317,167,0,0" Name="saveButton" VerticalAlignment="Top" Width="75" Click="saveButton_Click" />
        <Label Content="Successfully Edited Vehicle Type" Height="28" HorizontalAlignment="Left" Margin="221,194,0,0" Name="successLabel" VerticalAlignment="Top" Foreground="#FF489719" Visibility="Hidden" />
        <Button Content="Delete" Height="23" HorizontalAlignment="Left" Margin="156,167,0,0" Name="deleteButton" VerticalAlignment="Top" Width="75" Click="deleteButton_Click" />
    </Grid>
</Window>
